package com.stu.day02;

/**
 * 强转和隐式转换 判断奇偶性
 * @author zy
 * @date 2025/1/20 17:52:33
 */
public class Parity {
    public static void main(String[] args) {
        new Parity().parity(15);   //私有非静态方法,在本类中创建对象调用

        float f1 = 3.14f;  //须f结尾
        long l1 = 3145678;
        long l2 = 314_56_78;  //数字中间可插入_

        short s1 = 314_56;
        s1++;
        s1 += 1;
        s1 = (short) (s1 + 1);  //须强转
        System.out.println(s1);
    }

    private void parity(int n) {
        if((n & 1) == 0)
            System.out.println("偶数");
        else System.out.println("奇数");
    }
}
